<template>
  <el-pagination
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="1"
    :page-sizes="[10, 20, 50, 100, 200]"
    :page-size="50"
    :background="true"
    layout="total, sizes, prev, pager, next, jumper"
    :total="total">
  </el-pagination>
</template>

<script>
export default {
  name: "MyPagination",
  props:{
    total:{
      type:Number,
      required:true
    }
  },
  data(){
    return{
      pagination:{
        page:1,
        pageSize:50
      }
    }
  },

  methods:{
    handleSizeChange(val) {
      this.pagination.pageSize = val
      this.$emit('changePagination',this.pagination)
    },
    handleCurrentChange(val) {
      this.pagination.page = val
      this.$emit('changePagination',this.pagination)
    }
  }
}
</script>

<style scoped>

</style>
